-
Notifications
You must be signed in to change notification settings - Fork 9.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove "id" fields from schema definitions #1626
Conversation
The "id" field is built-in and not required in the schema. Future updates to helper/schema will cause these to fail validation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the ones which are Optional
, not just Computed
, there's possibly a bit more cleanup we can do - do you mind searching for "id"
and replace d.Set("id", ...)
w/ d.SetId()
and d.GetOk("id")
w/ d.Id()
?
Replace Set and Get with "id" keys with SetId and Id, and remove redundant uses of these. Remove a few more stray "id" fields in schemas. The few remaining are not at the top level and don't represent "resources" in their own.
d244c1e
to
37da2b0
Compare
Good idea @radeksimko. I updated the calls throughout, and found a few more top-level "id" fields that weren't caught by the unit tests. I also removed some |
Thanks for making those changes - I just ran a few experiments to verify @paddycarver 's thoughts about We can't just remove them 😢 , because in some cases they may be working (if the CRUD is correctly using data "aws_eip" "e" {
id = "eipalloc-0128413b" # This is currently valid and works just fine
} I'm thinking my validation may be more aggressive than I thought. I'm pondering with an idea of excluding data sources from the validation or allowing I'm more inclined to the latter (slowly allow phasing out) because it can be confusing to work with this field in the CRUD. It's not immediately obvious What do you think? |
It seems the documentation doesn't mention built-in id attribute https://www.terraform.io/docs/providers/aws/d/iam_server_certificate.html#attributes-reference |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
The "id" field is built-in and not required in the schema. Future
updates to helper/schema will cause these to fail validation.